package com.google.codejam;

import hu.mapro.jam.commons.Problem;

import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;
import java.util.Set;

import com.google.common.collect.Lists;
import com.google.common.collect.Ordering;
import com.google.common.collect.Sets;
import com.google.common.primitives.Doubles;
import com.google.common.primitives.Ints;

/**
 *  Using <a href="http://code.google.com/p/maprohu-codejam-lib/">Google Code Jam library</a>. 
 */
public class CruiseControl extends Problem {

	private static final int CL = 5;
	
	public CruiseControl() {
		super("C", true);
	}

	enum Lane {
		L {
			@Override
			Lane flip() {
				return R;
			}
		},
		R {
			@Override
			Lane flip() {
				return L;
			}
		},
		;
		abstract Lane flip();
	}
	
	class Group {
		
		Set<Car> members = Sets.newHashSet();
		
		boolean fixed = false;
		
		void join(Group other) {
			if (this==other) return;
			
			for (Car car : other.members) {
				car.group = this;
			}
			
			members.addAll(other.members);
		}

		public void flip() {
			for (Car car : members) {
				car.c = car.c.flip();
			}
		}
		
	}
	
	double t = 0;
	private List<Event> events;
	
	class Car {
		Lane c;
		int s;
		int p;
		
		double pt;
		
		int attachCount = 0;
		
		private Car(Lane c, int s, int p) {
			super();
			this.c = c;
			this.s = s;
			this.p = p;
			calcP();
			
			newGroup();
		}

		void newGroup() {
			this.group = new Group();
			group.members.add(this);
		}
		
		Group group;
		
		void calcP() {
			pt = p + s * t; 
		}
		
		boolean nextTo(Car other) {
			return Math.abs(pt - other.pt) < CL; 
		}

		public void detach() {
			attachCount--;
			
			if (attachCount==0) {
				group.members.remove(this);
				newGroup();
			}
		}
		
		void attach() {
			attachCount++;
		}
		
	}
	
	void attach(Car c1, Car c2) {
		c1.group.join(c2.group);
		c1.attachCount++;
		c2.attachCount++;
	}
	
	
	abstract class Event {
		Car slow;
		Car fast;
		double time;
		int typeOrder;
		
		private Event(Car slow, Car fast, double time, int typeOrder) {
			super();
			this.slow = slow;
			this.fast = fast;
			this.time = time;
			this.typeOrder = typeOrder;
		}

		abstract boolean perform();
		
	}
	
	class Attach extends Event {
		private Attach(Car slow, Car fast) {
			super(slow, fast, (double)(slow.p - fast.p - CL) / (fast.s - slow.s), 1);
		}

		@Override
		boolean perform() {
			slow.attach();
			fast.attach();
			
			Group g1 = slow.group;
			Group g2 = fast.group;
			if (g1!=g2) {
				if (slow.c == fast.c) {
					
					if (g1.fixed && g2.fixed) return false;
					if (!g1.fixed) g1.flip();
					else g2.flip();
				}
				
				g1.join(g2);
				g1.fixed = g1.fixed || g2.fixed;
			} else {
				if (slow.c == fast.c) return false;
			}
			
			return true;
		}
	}
	
	class Detach extends Event {
		private Detach(Car slow, Car fast) {
			super(slow, fast, (double)(slow.p - fast.p + CL) / (fast.s - slow.s), 0);
		}

		@Override
		boolean perform() {
			slow.detach();
			fast.detach();
			return true;
		}
	}

	Ordering<Event> eventOrdering = Ordering.from(
			new Comparator<Event>() {
				@Override
				public int compare(Event left, Event right) {
					return Doubles.compare(left.time, right.time);
				}
			}
	).compound(
			new Comparator<Event>() {
				@Override
				public int compare(Event left, Event right) {
					return Ints.compare(left.typeOrder, right.typeOrder);
				}
			}
	);
	
	void createEvents(Car slow, Car fast) {
		Attach attach = new Attach(slow, fast);
		Detach detach = new Detach(slow, fast);
		
		if (attach.time >= 0) {
			events.add(attach);
		}
		
		if (detach.time >= 0) {
			events.add(detach);
		}
		
	}
	
	@Override
	protected String solve(Scanner in) {
		int N = in.nextInt();
		
		Car[] cars = new Car[N];
		
		for (int i=0 ; i<N ; i++) {
			cars[i] = new Car(
					Lane.valueOf(in.next()), 
					in.nextInt(), 
					in.nextInt()
			);
		}
		
		events = Lists.newArrayList();
		
		for (int i = 0 ; i < N-1 ; i++) {
			Car c1 = cars[i];
			for (int j = i+1 ; j< N ; j++) {
				Car c2 = cars[j];
				if (c1.nextTo(c2)) {
					attach(c1, c2);
					c1.group.fixed = true;
				}
				
				if (c1.s < c2.s) {
					createEvents(c1, c2);
				} else if (c1.s > c2.s) {
					createEvents(c2, c1);
				}
			}
		}

		Collections.sort(events, eventOrdering);
		
		for (Event event : events) {
			if (!event.perform()) {
				return Double.toString(event.time);
			}
		}
		
		return "Possible";
	}

}
